package com.newasia.server.controller;

import com.newasia.server.common.result.ResponseData;
import com.newasia.server.common.result.ResponseUtil;
import com.newasia.server.service.IMonitorService;
import com.newasia.server.shiro.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author LiChong
 * @description 监控点控制
 * @date 2020/4/10
 */

@RestController
@RequestMapping("/monitor")
public class MonitorController {

    @Autowired
    IMonitorService monitorService;

    @GetMapping("/getModule/{moduleId}")
    public ResponseData getModule(@PathVariable Long moduleId){
        ResponseData data = monitorService.getModule(Long.valueOf(moduleId));
        return new ResponseUtil().setData(data);
    }

    @GetMapping("/getMonitorDetail/{sid}")
    public ResponseData getMonitorDetail(@PathVariable String sid){
        ResponseData data = monitorService.getMonitorDetail(sid);
        return new ResponseUtil().setData(data);
    }

    @GetMapping("/getMonitorStatusList")
    public ResponseData getMonitorStatusList(){
        ResponseData data = monitorService.getMonitorStatusList();
        return new ResponseUtil().setData(data);
    }
}
